<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <title>添加或编辑界面</title>
    <link rel="stylesheet" type="text/css" href="${s.base}/lib/layui/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/index.css"/>
    <link rel="stylesheet" type="text/css" href="${s.base}/css/base/theme/theme.css"/>
    <style>
        .w440{
            width: 440px !important;
        }
    </style>
</head>
<body>
<div class="page-content-wrap clearfix">
    <form class="layui-form" id="tool">
        <input type="hidden" name="applyId" value="${antiepidemicPerson.applyId}">
        <input type="hidden" name="memberId" value="${antiepidemicPerson.memberId}">
        <div class="layui-tab">
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;姓名：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="name" value="${antiepidemicPerson.name}" lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;电话号码：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="mobile" value="${antiepidemicPerson.mobile}" lay-verify="required" placeholder="请输入电话号码" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;身份证号：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="idCard" value="${antiepidemicPerson.idCard}" lay-verify="required" placeholder="请输入身份证号" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">&nbsp;车牌号：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="carNumber" value="${antiepidemicPerson.carNumber}" placeholder="请输入车牌号" autocomplete="off" class="layui-input" maxlength="10">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;小区住址：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="buildingId" value="${antiepidemicPerson.buildingInfo}" lay-verify="required" placeholder="请输入小区住址" autocomplete="off" class="layui-input" maxlength="200">
                            <input type="hidden" name="buildingId" value="${antiepidemicPerson.buildingId}">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;住户号：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="buildingRoom" value="${antiepidemicPerson.buildingRoom}" lay-verify="required" placeholder="请输入住户号" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;是否外地返芜：</label>
                        <div class="layui-input-inline w440">
                            <select name="returnStatus" id="returnStatus" lay-filter="returnStatus" lay-verify="required" ></select>
                        </div>
                    </div>
                    <div class="layui-form-item" id="showReturnTime" <#if antiepidemicPerson.returnStatus == "0">style="display: none"</#if>>
                        <label class="layui-form-label">&nbsp;返芜日期：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="returnTime" id="returnTime" value="<#if antiepidemicPerson.returnTime??><#if antiepidemicPerson.returnTime?is_date>${antiepidemicPerson.returnTime?string('yyyy-MM-dd')}<#elseif antiepidemicPerson.returnTime?is_string>${antiepidemicPerson.returnTime?substring(0,10)}</#if><#else>${antiepidemicPerson.returnTime}</#if>" placeholder="请输入返芜日期" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item" id="showReturnArea" <#if antiepidemicPerson.returnStatus == "0">style="display: none"</#if>>
                        <label class="layui-form-label">&nbsp;返程地区：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="returnArea" value="${antiepidemicPerson.returnArea}" placeholder="请输入返程地区" autocomplete="off" class="layui-input" maxlength="200">
                        </div>
                    </div>
                    <div class="layui-form-item" id="showOpidemicArea" <#if antiepidemicPerson.returnStatus == "0">style="display: none"</#if>>
                        <label class="layui-form-label"> 是否经过疫区：</label>
                        <div class="layui-input-inline w440">
                            <select name="epidemicArea" id="epidemicArea" ></select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">&nbsp;复工证明：</label>
                        <div class="layui-input-inline w440">
                            <div class="layui-upload" id="certificateObjectId"></div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="red">*</span>&nbsp;是否有复工证明：</label>
                        <div class="layui-input-inline w440">
                            <select name="certificateStatus" id="certificateStatus" lay-filter="certificateStatus" lay-verify="required" ></select>
                        </div>
                    </div>
                    <div class="layui-form-item" id="showCertificateTime" <#if antiepidemicPerson.certificateStatus == "0">style="display: none"</#if>>
                        <label class="layui-form-label">&nbsp;复工下班时间：</label>
                        <div class="layui-input-inline w440">
                            <input type="text" name="certificateTime" id="certificateTime" value="${antiepidemicPerson.certificateTime}" placeholder="请输入复工下班时间" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="margin-left: 0px !important;text-align: center">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="submitBtn">提交</button>
                <button type="button" id="cancel" class="layui-btn layui-btn-primary">取消</button>
                <button type="button" style="display: none;" id="save" class="layui-btn layui-btn-primary"></button>
            </div>
        </div>
    </form>
</div>
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script>
    layui.use(['jquery', 'form', 'page', 'laydate', 'fileUtil', 'baseutil'], function () {
        var $ = layui.jquery,
            form = layui.form,
            page = layui.page,
            laydate = layui.laydate,
            fileUtil = layui.fileUtil,
            baseutil = layui.baseutil;

        //初始化时间控件
        laydate.render({elem: '#returnTime', type: 'date'});

        laydate.render({elem: '#certificateTime', type: 'time', trigger: 'click'});

        //初始化附件控件
        fileUtil.uploadMultiFile('certificateObjectId', "work/antiepidemic/mult", '${antiepidemicPerson.certificateObjectId}');

        form.on('select(returnStatus)', function(data){
            // form.render('select');
            if (data.value == 1) {
                $("#showReturnTime").show();
                $("#showReturnArea").show();
                $("#showOpidemicArea").show();
            } else {
                $("#showReturnTime").hide();
                $("#showReturnArea").hide();
                $("#showOpidemicArea").hide();
            }
        });

        form.on('select(certificateStatus)', function(data){
            if (data.value == 1) {
                $("#showCertificateTime").show();
            } else {
                $("#showCertificateTime").hide();
            }
        });

        page.initDict('returnStatus,epidemicArea,certificateStatus', function (dictData) {
            page.showDict($("#returnStatus"), page.aceeptDictContentList(dictData, 'returnStatus'), "请选择", '${antiepidemicPerson.returnStatus}');
            page.showDict($("#epidemicArea"), page.aceeptDictContentList(dictData, 'epidemicArea'), "请选择", '${antiepidemicPerson.epidemicArea}');
            page.showDict($("#certificateStatus"), page.aceeptDictContentList(dictData, 'certificateStatus'), "请选择", '${antiepidemicPerson.certificateStatus}');
        });

        //监听提交
        form.on('submit(submitBtn)', function (data) {
            data.field.id = '${antiepidemicPerson.id}';
            baseutil.post("/work/antiepidemic/antiepidemicperson/addOrUpdate", data.field, function () {
                $("#save").click();
            });
            return false;
        });
    });
</script>
</body>
</html>